package com.fzshang.commen.util.sms;
import java.security.SecureRandom;
import java.util.Random;

/**
 * Created by Zhang on 2018/10/2.
 *
 */
public class SmsMarkError {
    //短信模板
    public static  final  String SMS_MARK="SMS_182669709";//  SMS_150174332
    public static  final  String accessKeyId="LTAIxZqSAWZR93uU";
    public static  final  String accessKeySecret="suF26NtU5GlnGlFt2NjNnjDUGxtUeR";

    private static final Random RANDOM = new SecureRandom();
    private static final String SYMBOLS = "0123456789"; // 数字


    /**
     * 获取长度为 6 的随机数字
     * @return 随机数字
     * @date 修改日志：由 space 创建于 2018-8-2 下午2:43:51
     */
    public static String getCode() {

        // 如果需要4位，那 new char[4] 即可，其他位数同理可得
        char[] nonceChars = new char[6];

        for (int index = 0; index < nonceChars.length; ++index) {
            nonceChars[index] = SYMBOLS.charAt(RANDOM.nextInt(SYMBOLS.length()));
        }

        return new String(nonceChars);
    }

}
